<?php

/**
 * This file is part of Switcher.
 * 
 * Switcher is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Switcher is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Switcher. If not, see <http://www.gnu.org/licenses/>.
 * 
 * @license http://www.opensource.org/licenses/gpl-3.0.html GPL-3.0
 */

namespace switcher\exceptions;

/**
 * Forwards the current request to another <i>view</i>. The target <i>view</i> should be
 * compatible with the source <i>view</i>. It means that they should expect the same
 * things, such as the same HTTP parameters.
 * 
 * @author Dri <switcher.framework@gmail.com>
 * @license http://www.opensource.org/licenses/gpl-3.0.html GPL-3.0
 * @package switcher\exceptions
 * @since 1.0.0
 */
final class ForwardException extends \Exception
{
	/**
	 * The name of the target view.
	 * @var string
	 */
	private $view;
	
	/**
	 * Constructor.
	 * 
	 * @param string $view The name of the target view.
	 */
	public function __construct($view)
	{
		$this->view = (string) $view;
	}
	
	/**
	 * Returns the name of the target view.
	 */
	public function getView()
	{
		return $this->view;
	}
}

?>